﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SHJunketingBLL;
using SHJunketingModel;

public partial class Admin_Permissions_AddInfo : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    //新增操作
    protected void btnEdit_Click(object sender, EventArgs e)
    {
        //判断用户名是否存在 
        if (C_PermissionManage.GetName(this.txtName.Text.Trim()) != null)
        {
            Web.CommFun.Show_Msg("用户名已存在！");
        }
        else
        {
            if (this.txtDesc.Text.Length > 100)
            {
                Web.CommFun.Show_Msg("请输入100字符以内的数字");
            }
            else
            {

                C_Permission cps = new C_Permission();
                cps.PermissionsName = this.txtName.Text.Trim();
                cps.PermissionsDesc = this.txtDesc.Text.Trim();
                Boolean add = C_PermissionManage.AddC_Permissions(cps);
                if (add)
                {
                    Web.CommFun.Show_Msg("添加成功！", "PermissionsInfo.aspx");
                }
                else
                {
                    Web.CommFun.Show_Msg("系统忙,请重试！", "PermissionsInfo.aspx");
                }
            }
        }
    }
}
